
from sanic import Blueprint

from controllers.trade_cal import TradeCalController
from decorators import response_json

bp = Blueprint("trade_cal", url_prefix="/trade_cal")


@bp.route("/<exchange:str>", methods=["GET"])
@response_json
async def trade_cal(request, exchange):
    """get 30 days trade cal recently"""
    return TradeCalController.get_recent_trade_cal(exchange)



@bp.route("/pull", methods=["GET"])
@response_json
async def pull_trade_cal(request):
    """ pull the trade_cal one year from online """
    trade_cal_ctl = TradeCalController.pull_one_year_trade_cal()

